﻿using Igloo.SharpSquare.Core;
using Igloo.SharpSquare.Entities;
using System;
using System.Collections.Generic;
using BigData.DataContracts.Objects;
using BigDataFramework.Repositories;
using BigData.DataContracts.Objects.BigData;
using MongoDB.Bson;

namespace BigDataFramework.Library.Objects.DataAdapters.FourSquare
{
    public abstract class FourSquareDataAdapterBase<T> : DataAdapterBase<T>
        where T : BigData.DataContracts.Objects.BigData.BaseTypes.BigDataDBObject_FiniteLife
    {
        // The user information needed by FourSquare in order for the app to connect to the FourSquare API
        private const string CLIENTID = "3XSBSSQBZGDGJMYTEWYFUEA30OPUBB1TCV4VYN2OHJG3T2QP";
        private const string CLIENTSECRET = "TMJFSHVUZFL4EUP0CV5ZZRDPK3RTIQQ4FOA2MZ3KTDVCTGSY";

        protected SharpSquare _Client { get; set; }

        protected FourSquareDataAdapterBase()
            : base()
        {
            this._Client = new SharpSquare(
                        clientId: CLIENTID
                    ,   clientSecret: CLIENTSECRET
                );
        }

        protected override abstract List<T> RetrieveDataFromAPIForUser(BigDataUser user, DateTime startDate, DateTime endDate);
        public override abstract BigData.DataContracts.Objects.BigData.Event ConvertObjToEvent(T obj);
    }
}
